home *** CD-ROM | disk | FTP | other *** search
- /**********************************************************************
- * This file contains the functions which let the user determine
- * which file to change the creator and/or file types.
- **********************************************************************/
-
- #include "Creator Changer.h"
- #include "Creator Changer.file.h"
-
-
-
- /**********************************************************************
- * Function Pick_File(), this function lets the user pick the file
- * that is to be changed.
- **********************************************************************/
-
- int Pick_File(void)
- {
-
- // If the user did not cancel, get the file information
- if(Old_File(File_Name, &V_Ref_Num))
- {
- GetFInfo(File_Name, V_Ref_Num, &File_Info);
- return(TRUE);
- }
- else return(FALSE);
-
- }
-
-
-
- /**********************************************************************
- * Function Old_File, this function calls the file to have the
- * creator and / or file type changed.
- **********************************************************************/
-
- int Old_File(Str32 fn, int *v_ref)
- {
-
- static Point SFGwhere={ 90, 82 }; // where to open the open dialog
- static SFReply reply;
- SFTypeList my_types;
-
- // I'm thinking about making a preference file with prefered ...
- // ... creator and file types in it. This is, of course, a while
- // down the road.
- my_types[0]='pref';
- SFGetFile(SFGwhere, "\p", NIL_PTR, -1, my_types, NIL_PTR, &reply);
- if(!reply.good) return(FALSE);
- else
- {
- p_Str_Copy(reply.fName, fn);
- *v_ref=reply.vRefNum;
- return(TRUE);
- }
-
- }
-
-
-
- /**********************************************************************
- * Function p_Str_Copy, this function copies one pascal string to
- * another pascal string.
- **********************************************************************/
-
- void p_Str_Copy(StringPtr p1, StringPtr p2)
- {
-
- register int len;
-
- len=*p2++=*p1++;
- while(--len>=0) *p2++=*p1++;
-
- }